#ifndef DATA_KALMAN_H
#define DATA_KALMAN_H

typedef struct {
    float x;                   // 状态估计值
    float k;                   // 卡尔曼增益
    float predict_error_cov;   // 估计误差协方差
    float process_noise_cov;   // 过程噪声协方差
    float measure_noise_cov;   // 测量噪声协方差
} DATA_KalmanFilter;

void DATA_KalmanFilter_Init(
    DATA_KalmanFilter *kf,
    float x,
    float predict_error_cov,
    float process_noise_cov,
    float measure_noise_cov
    );

void DATA_KalmanFilter_Predict(DATA_KalmanFilter *kf);
void DATA_KalmanFilter_Update(DATA_KalmanFilter *kf, float z);

#endif //DATA_KALMAN_H
